 
app.controller('shouyeCtrl',["$scope","$http",function($scope,$http){
	$scope.data = null;
	$scope.shop=[];
	$http.get('http://h5.yztctech.net/api/axf/apihome.php')
	.success(function(req){
		$scope.data = req.data;
//		console.log(req.data);
	});
	
	$scope.data = null;
	$http.get('http://h5.yztctech.net/api/axf/apihomehot.php')
	.success(function(req){
		$scope.shop = req.data;
	});
	//下面是轮播图请求图片的代码：
	$scope.reclist = [];
    $http.get('http://duif.applinzi.com/leyuan/home_data.php')
    .success(function(data){
    	$scope.reclist = data.reclist;
      	console.log(data.reclist);
    })
}])
//轮播图的代码：
 app.directive('mySwiper',function(){
    return {
        template: '<div class="swiper"></div>',
        replace: true,
        restrict: 'E',
        controller: function($scope){

        },
        scope: {
            imgs: '='
        },
        link: function(scope,ele,attr){

            setTimeout(function(){
            //console.log(scope.imgs)
            var html = '';
            var index = 0;
            for(var i = 0 ; i < scope.imgs.length ; i++){
            	html += '<div class="item"><img src="'+scope.imgs[i].img+'"></div>';
            }
            ele.html(html)

            setInterval(function(){
                ele.children().removeClass('active').eq(index).addClass('active');
                index++;
            },1000);
// hash
            },1000)
        }
    }
});